package jdbc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class jdbcdemo9
{
    public static void main(String[] args)
    {
        try (Connection con=DButil.getConnection())
        {
            String sql="INSERT INTO USER(USERNAME,PASSWORD,NICKNAME,AGE) VALUES(?,?,?,?)";
            PreparedStatement ps=con.prepareStatement(sql);
            ps.setString(1,"JOJO");
            ps.setString(2,"666666" );
            ps.setString(3,"JO" );
            ps.setInt(4,18);
            int count=ps.executeUpdate();
            System.out.println(count>0?"成功" : "失败");
        } catch (SQLException e) {e.printStackTrace();}
    }
}
